package com.example.peanutsubway.service.impl;

import com.example.peanutsubway.dao.impl.ChannelSortDaoImpl;
import com.example.peanutsubway.entity.ChannelSort;
import com.example.peanutsubway.entity.PageInfo;
import com.example.peanutsubway.service.ChannelSortService;
import com.example.peanutsubway.vo.ChannelSortParentName;
import java.util.List;

/**
 * @Author：liyangsong
 * @Version：1.0
 * @Date：2021/10/13-16:57
 * @Since:jdk1.8
 * @Description:
 */


public class ChannelSortServiceImpl implements ChannelSortService {
    private ChannelSortDaoImpl channelSortDao = new ChannelSortDaoImpl();

    @Override
    public PageInfo showChannelSort(ChannelSort channelSort, String pageNum, String nowPage) {
        Integer count = channelSortDao.count(channelSort);
        PageInfo page = new PageInfo(nowPage, pageNum, count);
        List<ChannelSortParentName> channelSorts = channelSortDao.showChannelSort(channelSort, page);
        page.setDataList(channelSorts);
        return page;
    }

    @Override
    public List<ChannelSort> ChannelSortfid(ChannelSort channelSort) {
        return channelSortDao.ChannelSortfid(channelSort);
    }

    @Override
    public List<ChannelSort> channelSortSid(Integer fid) {
        return channelSortDao.channelSortSid(fid);
    }

    @Override
    public Boolean addChannelSort(ChannelSort channelSort) {
        return channelSortDao.addChannelSort(channelSort);
    }

    @Override
    public Boolean deleChannelSort(Integer cid) {
        return channelSortDao.deleChannelSort(cid);
    }

    @Override
    public Boolean updateChannelSort(ChannelSort channelSort) {
        return channelSortDao.updateChannelSort(channelSort);
    }

    @Override
    public List<ChannelSort> allChannelSort(ChannelSort channelSort) {
        return channelSortDao.allChannelSort(channelSort);
    }
}
